package com.hualongdata.util.scalaapi

import scala.util.Random

/**
  * Created by hldev on 16-11-8.
  */
abstract class RandomHelper {
  val CHARS: Array[Char] = Array() ++ ('a' to 'z') ++ ('A' to 'Z') ++ ('0' to '9')

  def randomString(size: Int) = {
    (0 until size).map(_ => CHARS(Random.nextInt(CHARS.length))).mkString
  }
}

object RandomUtils extends RandomHelper
